package com.gz.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gz.utils.DataFmtUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * (Question)实体参数类
 *
 * @author makejava
 * @since 2024-02-19 15:38:03
 */
@Data
@ApiModel("Question实体参数类")
public class QuestionDto extends PageInfoDto implements Serializable {

  private static final long serialVersionUID = 815403398190295193L;
  @ApiModelProperty("题目id")
  private Integer id;
  @ApiModelProperty("题目id")
  private List<Integer> ids;
  @ApiModelProperty("题目标签")
  private String questionLabel;
  @ApiModelProperty("题目标签id集合")
  private List<Integer> questionLabelIds;
  @ApiModelProperty("智能试卷已存在题目id集合")
  private List<Integer> existQuesrtionIds;
  @ApiModelProperty("题目id集合")
  private List<Integer> questionIds;
  @ApiModelProperty("题目类型 1:选择题;2:填空题")
  private String questionType;
  @ApiModelProperty("科目")
  private String subject;
  @ApiModelProperty("题目图片")
  private String questionImg;
  @ApiModelProperty("题目答案")
  private String questionAnswer;
  @ApiModelProperty("题目详解")
  private String detailedSolution;
  @ApiModelProperty("题目详解图片")
  private String detailedSolutionImg;
  @ApiModelProperty("创建人id")
  private Integer crtId;
  @ApiModelProperty("创建时间")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private Date crtDt;
  @ApiModelProperty("更新人id")
  private Integer optId;
  @ApiModelProperty("更新时间")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private Date optDt;
  @ApiModelProperty("题目状态（0:下架，1:上架）")
  private Integer status;
  @ApiModelProperty("题目内容")
  private String questionContent;
  @ApiModelProperty("学层")
  private String level;
  @ApiModelProperty("年级")
  private String grade;
  @ApiModelProperty("排序字段")
  private String orderField;
  @ApiModelProperty("排序类型")
  private String orderType;
  @ApiModelProperty("限制条数")
  private Integer cntSize;

  public String getOrderField() {
    if (!StringUtils.isEmpty(orderField)) {
      return DataFmtUtil.xX2x_x(orderField);
    }
    return orderField;
  }
}

